#include "PacketObjectDestroy.h"
#include <iostream>
#include "Buffer.h"
PacketObjectDestroy::PacketObjectDestroy(void)
	:
	Packet(PACKET_TYPE::OBJECT_DESTROY),
	m_objectID(0)
{

}
PacketObjectDestroy::PacketObjectDestroy(long long objID)
	:
	Packet(PACKET_TYPE::OBJECT_DESTROY),
	m_objectID(objID)
{

}
PacketObjectDestroy::PacketObjectDestroy(Buffer& buffer)
{
	Read(buffer);
}
PacketObjectDestroy::~PacketObjectDestroy(void)
{

}

int PacketObjectDestroy::Write(void* buffer)
{
	int len = sizeof(*this) - 4;
	memcpy(buffer, (char*)this + 4, len); 
	return len;
}
void PacketObjectDestroy::Read(Buffer& buffer)
{
	buffer.Read(reinterpret_cast<char*>(this) + 4, sizeof(PacketObjectDestroy) - 4);
}
long long PacketObjectDestroy::GetObjectID(void) const
{
	return m_objectID;
}